Skip to content

❇️ Language filter on moderation queue#25

Merged
foysalit merged 14 commits intomainfrom
language-filter
Feb 21, 2024
Merged

❇️ Language filter on moderation queue#25
foysalit merged 14 commits intomainfrom
language-filter

Conversation

@foysalit
Copy link
Copy Markdown
Contributor

@foysalit foysalit commented Feb 9, 2024

Depends on bluesky-social/atproto#2161

language_filter.mov

👆🏽 Out of sync

Updated look at the language picker 👇🏽
Screenshot 2024-02-19 at 16 57 52

Notice that it allows moderators to select one or more languages and/or exclude one or more languages from the queue.

@foysalit foysalit requested a review from devinivy February 9, 2024 01:45
Base automatically changed from handle-to-did-url to main February 16, 2024 22:31
@bnewbold
Copy link
Copy Markdown
Collaborator

What we're going to want in the short-term is one "unreviewed" queue which is only Japanese (this PR makes this possible), and another "unreviewed" which is everything except Japanese.

To support this, maybe we need backend support for "not" tag filtering?

As a small UI tweak, I think we'll probably want the most common options at the top of the language drop-down menu: "everything", "english", "japanese", "portuguese", "german", "everything minus japanese"

@foysalit
Copy link
Copy Markdown
Contributor Author

@bnewbold makes sense! I built the dropdown to be a bit more robust so that we can choose multiple language and exclude multiple languages from the queue. Of course, this also covers the use-case you drew out.

@render
Copy link
Copy Markdown

render Bot commented Feb 19, 2024

@render
Copy link
Copy Markdown

render Bot commented Feb 19, 2024

Comment thread components/common/LanguagePicker.tsx Outdated
const excludedTags = excludeTagsParam?.split(',') || []
const includedLanguages = tags
.filter((tag) => tag.includes('lang:'))
.map((tag) => tag.split(':')[1])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This little snippet tag.split(':')[1] could be nicely self-documented by pulling it out into a function with a nice name.

Comment thread components/common/LanguagePicker.tsx Outdated
.filter((tag) => tag.includes('lang:'))
.map((tag) => tag.split(':')[1])
const excludedLanguages = excludedTags
.filter((tag) => tag.includes('lang:'))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably fine either way, but figure this is just as easy!

Suggested change
.filter((tag) => tag.includes('lang:'))
.filter((tag) => tag.startsWith('lang:'))

onClick={() => !isDisabled && onSelect(code2)}
key={code2}
>
{LANGUAGES_MAP_CODE2[code2].name}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything that guarantees that LANGUAGES_MAP_CODE2[code2] will exist? Maybe we could just document near availableLanguageCodes that it must be a subset of LANGUAGES_MAP_CODE2. Alternately we could mark certain items in LANGUAGES_MAP_CODE2 as "available".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah documenting availableLanguageCodes should do the job because the languages I've added are the ones that bryan suggested and overtime we may add more but even then, the LANGUAGES_MAP_CODE2 is quite comprehensive so I don't see a lang code ever missing there.

Copy link
Copy Markdown
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💎

Copy link
Copy Markdown
Collaborator

@bnewbold bnewbold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, this looks great!

I tested a bit in prod and excluding Japanese didn't seem to work. When toggling through "quick take action" (aka, left/right arrow keys), I came across japanese posts, and could see that they had been tagged lang:ja, and I could confirm that language filter setting was just "not japanese" (no positive selection).

@foysalit foysalit merged commit 3089191 into main Feb 21, 2024
@matthieusieben matthieusieben deleted the language-filter branch November 15, 2024 14:54
AdamWillford pushed a commit to Practical-Stoicism/bluesky-labeller that referenced this pull request Feb 11, 2025
AdamWillford pushed a commit to Practical-Stoicism/bluesky-labeller that referenced this pull request Feb 11, 2025
AdamWillford pushed a commit to Practical-Stoicism/bluesky-labeller that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants